#include<stdio.h>
#include<math.h>
double f(double x1,double y1,double x2,double y2)
{
	return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		double x1,y1,x2,y2,x3,y3;
		scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
		if(f(x1,y1,x3,y3)+f(x2,y2,x3,y3)==f(x1,y1,x2,y2))
			printf("Yes\n");
		else
			printf("No\n");
	}
	return 0;
}
